﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;
using SharedGenomics.Domain;

namespace SharedGenomics.Workbench.Models
{
    public class AddSchemaModel
    {
        private FileSchema _schema;

        public void Load(string filePath)
        {
            filePath.ThrowIfNull("filePath");
            this._schema = FileSchema.LoadFromXml(filePath);
        }

        public FileSchema LoadedSchema
        {
            get
            {
                ExceptionHelper.ThrowIf<InvalidOperationException>(this._schema == null, "No schema has been loaded");
                return this._schema;
            }
        }
    }
}
